using System;
using System.Collections.Generic;
using SouthernLand.Common.DAL.NhaDat;

namespace SouthernLand.Common.BOL.NhaDat
{
    public class TinhTrangPL
    {
        #region Public Properties

        public Int32 TinhtrangID { get; set; }

        public String TenTinhtrang { get; set; }

        public String TenTinhtrang_en { get; set; }

        #endregion

        #region public static Methods

        public static string GetTenTinhTrangPLByID(int ID)
        {
            try
            {
                TinhTrangPL obj = GetTinhTrangPLByID(ID);
                return Globals.GetLang(obj.TenTinhtrang, obj.TenTinhtrang_en);
            }
            catch
            {
                return "";
            }
        }


        public static int Insert(TinhTrangPL obj)
        {
            var db = new TinhTrangPLDAL();
            return db.Insert(obj);
        }

        public static bool Update(TinhTrangPL obj)
        {
            var db = new TinhTrangPLDAL();
            return db.Update(obj);
        }

        public static bool Delete(Int32 TinhtrangID)
        {
            var db = new TinhTrangPLDAL();
            return db.Delete(TinhtrangID);
        }

        public static TinhTrangPL GetTinhTrangPLByID(Int32 TinhtrangID)
        {
            var db = new TinhTrangPLDAL();
            return db.GetTinhTrangPLByID(TinhtrangID);
        }

        //Get All TinhTrangPL
        public static List<TinhTrangPL> GetAllTinhTrangPL()
        {
            var db = new TinhTrangPLDAL();
            return db.GetAllTinhTrangPL(1, 10000);
        }

        //Get All TinhTrangPL
        public static List<TinhTrangPL> GetAllTinhTrangPL(int PageIndex, int PageSize)
        {
            var db = new TinhTrangPLDAL();
            return db.GetAllTinhTrangPL(PageIndex, PageSize);
        }

        // Get Count All records of Table  TinhTrangPL
        public static int GetCountTinhTrangPL()
        {
            var db = new TinhTrangPLDAL();
            return db.GetCountTinhTrangPL();
        }

        #endregion
    }
}